package com.mobclick.android;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.location.Location;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.zip.Deflater;
import javax.microedition.khronos.opengles.GL10;
import org.json.JSONArray;
import org.json.JSONObject;

public class j
{
  static String a = "utf-8";
  public static int b;

  public static int a(Context paramContext, String paramString1, String paramString2)
  {
    int i;
    Field localField;
    try
    {
      localField = Class.forName(paramContext.getPackageName() + ".R$" + paramString1).getField(paramString2);
      int j = Integer.parseInt(localField.get(localField.getName()).toString());
      i = j;
      return i;
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
      {
        Log.i("MobclickAgent", "reflect resource error");
        localException.printStackTrace();
      }
      i = 0;
    }
  }

  public static int a(Date paramDate1, Date paramDate2)
  {
    Date localDate1;
    Date localDate2;
    if (paramDate1.after(paramDate2))
    {
      localDate1 = paramDate1;
      localDate2 = paramDate2;
    }
    while (true)
    {
      long l = localDate2.getTime();
      return (int)((localDate1.getTime() - l) / 1000L);
      localDate1 = paramDate2;
      localDate2 = paramDate1;
    }
  }

  // ERROR //
  public static String a()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_0
    //   2: new 110	java/io/FileReader
    //   5: dup
    //   6: ldc 112
    //   8: invokespecial 113	java/io/FileReader:<init>	(Ljava/lang/String;)V
    //   11: astore_1
    //   12: aload_1
    //   13: ifnull +32 -> 45
    //   16: new 115	java/io/BufferedReader
    //   19: dup
    //   20: aload_1
    //   21: sipush 1024
    //   24: invokespecial 118	java/io/BufferedReader:<init>	(Ljava/io/Reader;I)V
    //   27: astore_2
    //   28: aload_2
    //   29: invokevirtual 121	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   32: astore 10
    //   34: aload 10
    //   36: astore_0
    //   37: aload_2
    //   38: invokevirtual 124	java/io/BufferedReader:close	()V
    //   41: aload_1
    //   42: invokevirtual 125	java/io/FileReader:close	()V
    //   45: aload_0
    //   46: ifnull +16 -> 62
    //   49: aload_0
    //   50: iconst_1
    //   51: aload_0
    //   52: bipush 58
    //   54: invokevirtual 129	java/lang/String:indexOf	(I)I
    //   57: iadd
    //   58: invokevirtual 133	java/lang/String:substring	(I)Ljava/lang/String;
    //   61: astore_0
    //   62: aload_0
    //   63: invokevirtual 136	java/lang/String:trim	()Ljava/lang/String;
    //   66: areturn
    //   67: astore 7
    //   69: aconst_null
    //   70: astore 4
    //   72: aload 7
    //   74: astore 8
    //   76: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   79: ifeq +42 -> 121
    //   82: ldc 80
    //   84: ldc 138
    //   86: aload 8
    //   88: invokestatic 142	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   91: pop
    //   92: aload 4
    //   94: astore_0
    //   95: goto -50 -> 45
    //   98: astore_3
    //   99: aconst_null
    //   100: astore 4
    //   102: aload_3
    //   103: astore 5
    //   105: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   108: ifeq +13 -> 121
    //   111: ldc 80
    //   113: ldc 144
    //   115: aload 5
    //   117: invokestatic 142	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   120: pop
    //   121: aload 4
    //   123: astore_0
    //   124: goto -79 -> 45
    //   127: astore 12
    //   129: aload_0
    //   130: astore 4
    //   132: aload 12
    //   134: astore 5
    //   136: goto -31 -> 105
    //   139: astore 5
    //   141: goto -36 -> 105
    //   144: astore 11
    //   146: aload_0
    //   147: astore 4
    //   149: aload 11
    //   151: astore 8
    //   153: goto -77 -> 76
    //
    // Exception table:
    //   from	to	target	type
    //   16	34	67	java/io/IOException
    //   2	12	98	java/io/FileNotFoundException
    //   16	34	98	java/io/FileNotFoundException
    //   37	45	127	java/io/FileNotFoundException
    //   76	92	139	java/io/FileNotFoundException
    //   37	45	144	java/io/IOException
  }

  public static String a(String paramString, boolean paramBoolean)
  {
    String str;
    MessageDigest localMessageDigest;
    try
    {
      localMessageDigest = MessageDigest.getInstance("MD5");
      localMessageDigest.update(paramString.getBytes());
      byte[] arrayOfByte = localMessageDigest.digest();
      StringBuffer localStringBuffer = new StringBuffer();
      int i = 0;
      if (i >= arrayOfByte.length)
      {
        str = localStringBuffer.toString();
      }
      else
      {
        int j = 0xFF & arrayOfByte[i];
        if ((j < 16) && (!(paramBoolean)))
          localStringBuffer.append("0");
        localStringBuffer.append(Integer.toHexString(j));
        ++i;
      }
    }
    catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
    {
      if (UmengConstants.testMode)
      {
        Log.i("MobclickAgent", "getMD5 error");
        localNoSuchAlgorithmException.printStackTrace();
      }
      str = "";
      return str;
    }
  }

  public static String a(Date paramDate)
  {
    return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(paramDate);
  }

  public static String a(JSONObject paramJSONObject)
  {
    try
    {
      if (paramJSONObject.has("channel"))
        paramJSONObject.put("channel", URLEncoder.encode(paramJSONObject.getString("channel"), "UTF-8"));
      return paramJSONObject.toString();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public static void a(Context paramContext)
  {
    Toast.makeText(paramContext, paramContext.getString(a(paramContext, "string", "UMToast_IsUpdating")), 0).show();
  }

  public static void a(Context paramContext, Date paramDate)
  {
    SharedPreferences.Editor localEditor = paramContext.getSharedPreferences("exchange_last_request_time", 0).edit();
    localEditor.putString("last_request_time", a(paramDate));
    localEditor.commit();
  }

  public static boolean a(Context paramContext, String paramString)
  {
    int i;
    if (paramContext.getPackageManager().checkPermission(paramString, paramContext.getPackageName()) == 0)
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  public static byte[] a(String paramString)
  {
    b = 0;
    Deflater localDeflater = new Deflater();
    localDeflater.setInput(paramString.getBytes(a));
    localDeflater.finish();
    byte[] arrayOfByte = new byte[8192];
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    while (true)
    {
      if (localDeflater.finished())
      {
        localDeflater.end();
        return localByteArrayOutputStream.toByteArray();
      }
      int i = localDeflater.deflate(arrayOfByte);
      b = i + b;
      localByteArrayOutputStream.write(arrayOfByte, 0, i);
    }
  }

  public static String[] a(GL10 paramGL10)
  {
    String[] arrayOfString;
    try
    {
      arrayOfString = new String[2];
      String str1 = paramGL10.glGetString(7936);
      String str2 = paramGL10.glGetString(7937);
      arrayOfString[0] = str1;
      arrayOfString[1] = str2;
      return arrayOfString;
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "Could not read gpu infor:", localException);
      arrayOfString = new String[0];
    }
  }

  public static String b()
  {
    Date localDate = new Date();
    return new SimpleDateFormat("yyyy-MM-dd").format(localDate);
  }

  public static String b(Context paramContext)
  {
    String str1;
    ApplicationInfo localApplicationInfo;
    try
    {
      localApplicationInfo = paramContext.getPackageManager().getApplicationInfo(paramContext.getPackageName(), 128);
      if (localApplicationInfo != null)
      {
        String str2 = localApplicationInfo.metaData.getString("UMENG_APPKEY");
        if (str2 != null)
        {
          str1 = str2.trim();
          break label91:
        }
        if (UmengConstants.testMode)
          Log.e("MobclickAgent", "Could not read UMENG_APPKEY meta-data from AndroidManifest.xml.");
      }
      str1 = null;
    }
    catch (Exception localException)
    {
      while (true)
      {
        if (!(UmengConstants.testMode));
        Log.e("MobclickAgent", "Could not read UMENG_APPKEY meta-data from AndroidManifest.xml.");
        localException.printStackTrace();
      }
    }
    label91: return str1;
  }

  public static String b(JSONObject paramJSONObject)
  {
    String str;
    JSONObject localJSONObject1;
    int j;
    try
    {
      int i;
      localJSONObject1 = paramJSONObject.optJSONObject("header");
      if (localJSONObject1 != null)
      {
        if (localJSONObject1.has("access_subtype"))
          localJSONObject1.put("access_subtype", URLEncoder.encode(localJSONObject1.getString("access_subtype"), "UTF-8"));
        if (localJSONObject1.has("cpu"))
          localJSONObject1.put("cpu", URLEncoder.encode(localJSONObject1.getString("cpu"), "UTF-8"));
        if (localJSONObject1.has("app_version"))
          localJSONObject1.put("app_version", URLEncoder.encode(localJSONObject1.getString("app_version"), "UTF-8"));
        if (localJSONObject1.has("country"))
          localJSONObject1.put("country", URLEncoder.encode(localJSONObject1.getString("country"), "UTF-8"));
        if (localJSONObject1.has("device_model"))
          localJSONObject1.put("device_model", URLEncoder.encode(localJSONObject1.getString("device_model"), "UTF-8"));
        if (localJSONObject1.has("carrier"))
          localJSONObject1.put("carrier", URLEncoder.encode(localJSONObject1.getString("carrier"), "UTF-8"));
        if (localJSONObject1.has("language"))
          localJSONObject1.put("language", URLEncoder.encode(localJSONObject1.getString("language"), "UTF-8"));
        if (localJSONObject1.has("channel"))
          localJSONObject1.put("channel", URLEncoder.encode(localJSONObject1.getString("channel"), "UTF-8"));
      }
      JSONObject localJSONObject2 = paramJSONObject.optJSONObject("body");
      JSONArray localJSONArray1 = localJSONObject2.optJSONArray("event");
      if (localJSONArray1 != null)
      {
        j = 0;
        if (j < localJSONArray1.length())
          break label322;
      }
      JSONArray localJSONArray2 = localJSONObject2.optJSONArray("error");
      if (localJSONArray2 != null)
      {
        i = 0;
        if (i < localJSONArray2.length())
          break label401;
      }
      str = paramJSONObject.toString();
      break label462:
      label322: JSONObject localJSONObject4 = localJSONArray1.optJSONObject(j);
      if (localJSONObject4 != null)
      {
        if (localJSONObject4.has("label"))
          localJSONObject4.put("label", URLEncoder.encode(localJSONObject4.getString("label")));
        if (localJSONObject4.has("tag"))
        {
          localJSONObject4.put("tag", URLEncoder.encode(localJSONObject4.getString("tag")));
          break label464:
          label401: JSONObject localJSONObject3 = localJSONArray2.optJSONObject(i);
          if ((localJSONObject3 != null) && (localJSONObject3.has("context")))
            localJSONObject3.put("context", URLEncoder.encode(localJSONObject3.getString("context")));
          label462: label464: ++i;
        }
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        str = paramJSONObject.toString();
        return str;
        ++j;
      }
    }
  }

  public static Date b(String paramString)
  {
    Date localDate1;
    Date localDate2;
    try
    {
      localDate2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(paramString);
      localDate1 = localDate2;
      return localDate1;
    }
    catch (Exception localException)
    {
      localDate1 = null;
    }
  }

  public static String c(Context paramContext)
  {
    String str1;
    TelephonyManager localTelephonyManager = (TelephonyManager)paramContext.getSystemService("phone");
    if ((localTelephonyManager == null) && (UmengConstants.testMode))
      Log.w("MobclickAgent", "No IMEI.");
    try
    {
      if (a(paramContext, "android.permission.READ_PHONE_STATE"))
      {
        String str2 = localTelephonyManager.getDeviceId();
        str1 = str2;
        if (TextUtils.isEmpty(str1))
        {
          if (UmengConstants.testMode)
            Log.w("MobclickAgent", "No IMEI.");
          str1 = j(paramContext);
          if (str1 == null)
          {
            if (UmengConstants.testMode)
              Log.w("MobclickAgent", "Failed to take mac as IMEI.");
            str1 = null;
          }
        }
        return str1;
      }
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
      {
        Log.w("MobclickAgent", "No IMEI.");
        localException.printStackTrace();
      }
      str1 = "";
    }
  }

  public static String d(Context paramContext)
  {
    return a(c(paramContext), true);
  }

  public static Date e(Context paramContext)
  {
    return b(paramContext.getSharedPreferences("exchange_last_request_time", 0).getString("last_request_time", "1900-01-01 00:00:00"));
  }

  // ERROR //
  public static JSONObject f(Context paramContext)
  {
    // Byte code:
    //   0: new 197	org/json/JSONObject
    //   3: dup
    //   4: invokespecial 438	org/json/JSONObject:<init>	()V
    //   7: astore_1
    //   8: aload_0
    //   9: ldc_w 392
    //   12: invokevirtual 396	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   15: checkcast 398	android/telephony/TelephonyManager
    //   18: astore 5
    //   20: aload_0
    //   21: invokestatic 440	com/mobclick/android/j:d	(Landroid/content/Context;)Ljava/lang/String;
    //   24: astore 6
    //   26: aload 6
    //   28: ifnull +13 -> 41
    //   31: aload 6
    //   33: ldc 183
    //   35: invokevirtual 444	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   38: ifeq +21 -> 59
    //   41: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   44: ifeq +1024 -> 1068
    //   47: ldc 80
    //   49: ldc_w 446
    //   52: invokestatic 338	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   55: pop
    //   56: goto +1012 -> 1068
    //   59: aload_1
    //   60: ldc_w 448
    //   63: aload_0
    //   64: invokestatic 424	com/mobclick/android/j:c	(Landroid/content/Context;)Ljava/lang/String;
    //   67: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   70: pop
    //   71: aload_1
    //   72: ldc_w 450
    //   75: aload 6
    //   77: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   80: pop
    //   81: aload_1
    //   82: ldc_w 354
    //   85: getstatic 455	android/os/Build:MODEL	Ljava/lang/String;
    //   88: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   91: pop
    //   92: aload_0
    //   93: invokestatic 457	com/mobclick/android/j:b	(Landroid/content/Context;)Ljava/lang/String;
    //   96: astore 11
    //   98: aload 11
    //   100: ifnonnull +21 -> 121
    //   103: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   106: ifeq +966 -> 1072
    //   109: ldc 80
    //   111: ldc_w 459
    //   114: invokestatic 338	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   117: pop
    //   118: goto +954 -> 1072
    //   121: aload_1
    //   122: ldc_w 461
    //   125: aload 11
    //   127: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   130: pop
    //   131: getstatic 463	com/mobclick/android/UmengConstants:channel	Ljava/lang/String;
    //   134: ifnull +499 -> 633
    //   137: getstatic 463	com/mobclick/android/UmengConstants:channel	Ljava/lang/String;
    //   140: astore 13
    //   142: aload_1
    //   143: ldc 195
    //   145: aload 13
    //   147: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   150: pop
    //   151: aload_0
    //   152: invokevirtual 268	android/content/Context:getPackageManager	()Landroid/content/pm/PackageManager;
    //   155: aload_0
    //   156: invokevirtual 28	android/content/Context:getPackageName	()Ljava/lang/String;
    //   159: iconst_0
    //   160: invokevirtual 467	android/content/pm/PackageManager:getPackageInfo	(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    //   163: astore 73
    //   165: aload 73
    //   167: getfield 472	android/content/pm/PackageInfo:versionName	Ljava/lang/String;
    //   170: astore 74
    //   172: aload 73
    //   174: getfield 475	android/content/pm/PackageInfo:versionCode	I
    //   177: istore 75
    //   179: aload_1
    //   180: ldc_w 350
    //   183: aload 74
    //   185: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   188: pop
    //   189: aload_1
    //   190: ldc_w 477
    //   193: iload 75
    //   195: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   198: pop
    //   199: aload_1
    //   200: ldc_w 482
    //   203: ldc_w 484
    //   206: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   209: pop
    //   210: aload_1
    //   211: ldc_w 486
    //   214: ldc_w 488
    //   217: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   220: pop
    //   221: aload_1
    //   222: ldc_w 490
    //   225: ldc_w 484
    //   228: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   231: pop
    //   232: aload_1
    //   233: ldc_w 492
    //   236: getstatic 497	android/os/Build$VERSION:RELEASE	Ljava/lang/String;
    //   239: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   242: pop
    //   243: new 499	android/content/res/Configuration
    //   246: dup
    //   247: invokespecial 500	android/content/res/Configuration:<init>	()V
    //   250: astore 22
    //   252: aload_0
    //   253: invokevirtual 504	android/content/Context:getContentResolver	()Landroid/content/ContentResolver;
    //   256: aload 22
    //   258: invokestatic 510	android/provider/Settings$System:getConfiguration	(Landroid/content/ContentResolver;Landroid/content/res/Configuration;)V
    //   261: aload 22
    //   263: ifnull +477 -> 740
    //   266: aload 22
    //   268: getfield 514	android/content/res/Configuration:locale	Ljava/util/Locale;
    //   271: ifnull +469 -> 740
    //   274: aload_1
    //   275: ldc_w 352
    //   278: aload 22
    //   280: getfield 514	android/content/res/Configuration:locale	Ljava/util/Locale;
    //   283: invokevirtual 519	java/util/Locale:getCountry	()Ljava/lang/String;
    //   286: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   289: pop
    //   290: aload_1
    //   291: ldc_w 358
    //   294: aload 22
    //   296: getfield 514	android/content/res/Configuration:locale	Ljava/util/Locale;
    //   299: invokevirtual 520	java/util/Locale:toString	()Ljava/lang/String;
    //   302: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   305: pop
    //   306: aload 22
    //   308: getfield 514	android/content/res/Configuration:locale	Ljava/util/Locale;
    //   311: invokestatic 525	java/util/Calendar:getInstance	(Ljava/util/Locale;)Ljava/util/Calendar;
    //   314: astore 67
    //   316: aload 67
    //   318: ifnull +409 -> 727
    //   321: aload 67
    //   323: invokevirtual 529	java/util/Calendar:getTimeZone	()Ljava/util/TimeZone;
    //   326: astore 69
    //   328: aload 69
    //   330: ifnull +384 -> 714
    //   333: aload_1
    //   334: ldc_w 531
    //   337: aload 69
    //   339: invokevirtual 536	java/util/TimeZone:getRawOffset	()I
    //   342: ldc_w 537
    //   345: idiv
    //   346: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   349: pop
    //   350: new 539	android/util/DisplayMetrics
    //   353: dup
    //   354: invokespecial 540	android/util/DisplayMetrics:<init>	()V
    //   357: astore 27
    //   359: aload_0
    //   360: ldc_w 542
    //   363: invokevirtual 396	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   366: checkcast 544	android/view/WindowManager
    //   369: invokeinterface 548 1 0
    //   374: aload 27
    //   376: invokevirtual 554	android/view/Display:getMetrics	(Landroid/util/DisplayMetrics;)V
    //   379: aload 27
    //   381: getfield 557	android/util/DisplayMetrics:widthPixels	I
    //   384: istore 52
    //   386: aload_1
    //   387: ldc_w 559
    //   390: new 22	java/lang/StringBuilder
    //   393: dup
    //   394: aload 27
    //   396: getfield 562	android/util/DisplayMetrics:heightPixels	I
    //   399: invokestatic 564	java/lang/String:valueOf	(I)Ljava/lang/String;
    //   402: invokestatic 34	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   405: invokespecial 37	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   408: ldc_w 566
    //   411: invokevirtual 43	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   414: iload 52
    //   416: invokestatic 564	java/lang/String:valueOf	(I)Ljava/lang/String;
    //   419: invokevirtual 43	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   422: invokevirtual 46	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   425: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   428: pop
    //   429: aload_0
    //   430: invokestatic 570	com/mobclick/android/j:g	(Landroid/content/Context;)[Ljava/lang/String;
    //   433: astore 48
    //   435: aload_1
    //   436: ldc_w 572
    //   439: aload 48
    //   441: iconst_0
    //   442: aaload
    //   443: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   446: pop
    //   447: aload 48
    //   449: iconst_0
    //   450: aaload
    //   451: ldc_w 574
    //   454: invokevirtual 444	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   457: ifeq +15 -> 472
    //   460: aload_1
    //   461: ldc_w 346
    //   464: aload 48
    //   466: iconst_1
    //   467: aaload
    //   468: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   471: pop
    //   472: aload_1
    //   473: ldc_w 356
    //   476: aload 5
    //   478: invokevirtual 577	android/telephony/TelephonyManager:getNetworkOperatorName	()Ljava/lang/String;
    //   481: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   484: pop
    //   485: getstatic 580	com/mobclick/android/UmengConstants:LOCATION_OPEN	Z
    //   488: ifeq +46 -> 534
    //   491: aload_0
    //   492: invokestatic 584	com/mobclick/android/j:k	(Landroid/content/Context;)Landroid/location/Location;
    //   495: astore 40
    //   497: aload 40
    //   499: ifnull +548 -> 1047
    //   502: aload_1
    //   503: ldc_w 586
    //   506: aload 40
    //   508: invokevirtual 592	android/location/Location:getLatitude	()D
    //   511: invokestatic 595	java/lang/String:valueOf	(D)Ljava/lang/String;
    //   514: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   517: pop
    //   518: aload_1
    //   519: ldc_w 597
    //   522: aload 40
    //   524: invokevirtual 600	android/location/Location:getLongitude	()D
    //   527: invokestatic 595	java/lang/String:valueOf	(D)Ljava/lang/String;
    //   530: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   533: pop
    //   534: aload_1
    //   535: ldc_w 348
    //   538: invokestatic 602	com/mobclick/android/j:a	()Ljava/lang/String;
    //   541: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   544: pop
    //   545: getstatic 607	com/mobclick/android/MobclickAgent:GPU_VENDER	Ljava/lang/String;
    //   548: ldc 183
    //   550: invokevirtual 444	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   553: ifne +14 -> 567
    //   556: aload_1
    //   557: ldc_w 609
    //   560: getstatic 607	com/mobclick/android/MobclickAgent:GPU_VENDER	Ljava/lang/String;
    //   563: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   566: pop
    //   567: getstatic 612	com/mobclick/android/MobclickAgent:GPU_RENDERER	Ljava/lang/String;
    //   570: ldc 183
    //   572: invokevirtual 444	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   575: ifne +14 -> 589
    //   578: aload_1
    //   579: ldc_w 614
    //   582: getstatic 612	com/mobclick/android/MobclickAgent:GPU_RENDERER	Ljava/lang/String;
    //   585: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   588: pop
    //   589: getstatic 617	com/mobclick/android/UmengConstants:canCollectionUserInfo	Z
    //   592: ifeq +24 -> 616
    //   595: aload_0
    //   596: invokestatic 620	com/mobclick/android/j:l	(Landroid/content/Context;)Lorg/json/JSONObject;
    //   599: astore 36
    //   601: aload 36
    //   603: ifnull +13 -> 616
    //   606: aload_1
    //   607: ldc_w 622
    //   610: aload 36
    //   612: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   615: pop
    //   616: aload_1
    //   617: ldc_w 624
    //   620: aload_0
    //   621: invokevirtual 28	android/content/Context:getPackageName	()Ljava/lang/String;
    //   624: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   627: pop
    //   628: aload_1
    //   629: astore_3
    //   630: goto +440 -> 1070
    //   633: aload_0
    //   634: invokestatic 627	com/mobclick/android/j:h	(Landroid/content/Context;)Ljava/lang/String;
    //   637: astore 13
    //   639: goto -497 -> 142
    //   642: astore 15
    //   644: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   647: ifeq +17 -> 664
    //   650: ldc 80
    //   652: ldc_w 629
    //   655: invokestatic 88	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   658: pop
    //   659: aload 15
    //   661: invokevirtual 630	android/content/pm/PackageManager$NameNotFoundException:printStackTrace	()V
    //   664: aload_1
    //   665: ldc_w 350
    //   668: ldc_w 632
    //   671: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   674: pop
    //   675: aload_1
    //   676: ldc_w 477
    //   679: ldc_w 632
    //   682: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   685: pop
    //   686: goto -487 -> 199
    //   689: astore_2
    //   690: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   693: ifeq +16 -> 709
    //   696: ldc 80
    //   698: ldc_w 634
    //   701: invokestatic 338	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   704: pop
    //   705: aload_2
    //   706: invokevirtual 91	java/lang/Exception:printStackTrace	()V
    //   709: aconst_null
    //   710: astore_3
    //   711: goto +359 -> 1070
    //   714: aload_1
    //   715: ldc_w 531
    //   718: bipush 8
    //   720: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   723: pop
    //   724: goto -374 -> 350
    //   727: aload_1
    //   728: ldc_w 531
    //   731: bipush 8
    //   733: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   736: pop
    //   737: goto -387 -> 350
    //   740: invokestatic 638	java/util/Locale:getDefault	()Ljava/util/Locale;
    //   743: astore 23
    //   745: getstatic 641	com/mobclick/android/UmengConstants:canUseLCT	Z
    //   748: ifeq +156 -> 904
    //   751: aload 23
    //   753: ifnull +151 -> 904
    //   756: aload 23
    //   758: invokevirtual 519	java/util/Locale:getCountry	()Ljava/lang/String;
    //   761: astore 54
    //   763: aload 54
    //   765: invokestatic 416	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   768: ifne +82 -> 850
    //   771: aload_1
    //   772: ldc_w 352
    //   775: aload 54
    //   777: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   780: pop
    //   781: aload 23
    //   783: invokevirtual 644	java/util/Locale:getLanguage	()Ljava/lang/String;
    //   786: astore 56
    //   788: aload 56
    //   790: invokestatic 416	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   793: ifne +71 -> 864
    //   796: aload_1
    //   797: ldc_w 358
    //   800: aload 56
    //   802: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   805: pop
    //   806: aload 23
    //   808: invokestatic 525	java/util/Calendar:getInstance	(Ljava/util/Locale;)Ljava/util/Calendar;
    //   811: astore 58
    //   813: aload 58
    //   815: ifnull +76 -> 891
    //   818: aload 58
    //   820: invokevirtual 529	java/util/Calendar:getTimeZone	()Ljava/util/TimeZone;
    //   823: astore 60
    //   825: aload 60
    //   827: ifnull +51 -> 878
    //   830: aload_1
    //   831: ldc_w 531
    //   834: aload 60
    //   836: invokevirtual 536	java/util/TimeZone:getRawOffset	()I
    //   839: ldc_w 537
    //   842: idiv
    //   843: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   846: pop
    //   847: goto -497 -> 350
    //   850: aload_1
    //   851: ldc_w 352
    //   854: ldc_w 646
    //   857: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   860: pop
    //   861: goto -80 -> 781
    //   864: aload_1
    //   865: ldc_w 358
    //   868: ldc_w 646
    //   871: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   874: pop
    //   875: goto -69 -> 806
    //   878: aload_1
    //   879: ldc_w 531
    //   882: bipush 8
    //   884: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   887: pop
    //   888: goto -538 -> 350
    //   891: aload_1
    //   892: ldc_w 531
    //   895: bipush 8
    //   897: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   900: pop
    //   901: goto -551 -> 350
    //   904: aload_1
    //   905: ldc_w 352
    //   908: ldc_w 646
    //   911: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   914: pop
    //   915: aload_1
    //   916: ldc_w 358
    //   919: ldc_w 646
    //   922: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   925: pop
    //   926: aload_1
    //   927: ldc_w 531
    //   930: bipush 8
    //   932: invokevirtual 480	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   935: pop
    //   936: goto -586 -> 350
    //   939: astore 28
    //   941: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   944: ifeq +17 -> 961
    //   947: ldc 80
    //   949: ldc_w 648
    //   952: invokestatic 338	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   955: pop
    //   956: aload 28
    //   958: invokevirtual 91	java/lang/Exception:printStackTrace	()V
    //   961: aload_1
    //   962: ldc_w 559
    //   965: ldc_w 646
    //   968: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   971: pop
    //   972: goto -543 -> 429
    //   975: astore 30
    //   977: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   980: ifeq +17 -> 997
    //   983: ldc 80
    //   985: ldc_w 650
    //   988: invokestatic 88	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   991: pop
    //   992: aload 30
    //   994: invokevirtual 91	java/lang/Exception:printStackTrace	()V
    //   997: aload_1
    //   998: ldc_w 572
    //   1001: ldc_w 646
    //   1004: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   1007: pop
    //   1008: goto -536 -> 472
    //   1011: astore 32
    //   1013: getstatic 78	com/mobclick/android/UmengConstants:testMode	Z
    //   1016: ifeq +17 -> 1033
    //   1019: ldc 80
    //   1021: ldc_w 652
    //   1024: invokestatic 88	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   1027: pop
    //   1028: aload 32
    //   1030: invokevirtual 91	java/lang/Exception:printStackTrace	()V
    //   1033: aload_1
    //   1034: ldc_w 356
    //   1037: ldc_w 646
    //   1040: invokevirtual 217	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   1043: pop
    //   1044: goto -559 -> 485
    //   1047: aload_1
    //   1048: ldc_w 586
    //   1051: dconst_0
    //   1052: invokevirtual 655	org/json/JSONObject:put	(Ljava/lang/String;D)Lorg/json/JSONObject;
    //   1055: pop
    //   1056: aload_1
    //   1057: ldc_w 597
    //   1060: dconst_0
    //   1061: invokevirtual 655	org/json/JSONObject:put	(Ljava/lang/String;D)Lorg/json/JSONObject;
    //   1064: pop
    //   1065: goto -531 -> 534
    //   1068: aconst_null
    //   1069: astore_3
    //   1070: aload_3
    //   1071: areturn
    //   1072: aconst_null
    //   1073: astore_3
    //   1074: goto -4 -> 1070
    //
    // Exception table:
    //   from	to	target	type
    //   151	199	642	android/content/pm/PackageManager$NameNotFoundException
    //   8	151	689	java/lang/Exception
    //   151	199	689	java/lang/Exception
    //   199	350	689	java/lang/Exception
    //   485	686	689	java/lang/Exception
    //   714	1065	689	java/lang/Exception
    //   350	429	939	java/lang/Exception
    //   429	472	975	java/lang/Exception
    //   472	485	1011	java/lang/Exception
  }

  public static String[] g(Context paramContext)
  {
    String[] arrayOfString = new String[2];
    arrayOfString[0] = "Unknown";
    arrayOfString[1] = "Unknown";
    if (paramContext.getPackageManager().checkPermission("android.permission.ACCESS_NETWORK_STATE", paramContext.getPackageName()) != 0)
      arrayOfString[0] = "Unknown";
    while (true)
    {
      NetworkInfo localNetworkInfo;
      do
      {
        ConnectivityManager localConnectivityManager;
        while (true)
        {
          while (true)
          {
            return arrayOfString;
            localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
            if (localConnectivityManager != null)
              break;
            arrayOfString[0] = "Unknown";
          }
          if (localConnectivityManager.getNetworkInfo(1).getState() != NetworkInfo.State.CONNECTED)
            break;
          arrayOfString[0] = "Wi-Fi";
        }
        localNetworkInfo = localConnectivityManager.getNetworkInfo(0);
      }
      while (localNetworkInfo.getState() != NetworkInfo.State.CONNECTED);
      arrayOfString[0] = "2G/3G";
      arrayOfString[1] = localNetworkInfo.getSubtypeName();
    }
  }

  public static String h(Context paramContext)
  {
    if (UmengConstants.channel != null)
    {
      localObject1 = UmengConstants.channel;
      return localObject1;
    }
    Object localObject1 = "Unknown";
    try
    {
      ApplicationInfo localApplicationInfo = paramContext.getPackageManager().getApplicationInfo(paramContext.getPackageName(), 128);
      if ((localApplicationInfo != null) && (localApplicationInfo.metaData != null))
      {
        Object localObject2 = localApplicationInfo.metaData.get("UMENG_CHANNEL");
        if (localObject2 != null)
        {
          String str = localObject2.toString();
          if (str == null)
            break label85;
          localObject1 = str;
        }
      }
      label85: 
      do
        while (true)
          UmengConstants.channel = (String)localObject1;
      while (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "Could not read UMENG_CHANNEL meta-data from AndroidManifest.xml.");
    }
    catch (Exception localException)
    {
      if (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "Could not read UMENG_CHANNEL meta-data from AndroidManifest.xml.");
      localException.printStackTrace();
    }
  }

  public static boolean i(Context paramContext)
  {
    int i;
    ConnectivityManager localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
    if (localConnectivityManager == null)
      i = 0;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return i;
          if (localConnectivityManager.getNetworkInfo(0).getState() != NetworkInfo.State.CONNECTED)
            break;
          i = 1;
        }
        if (localConnectivityManager.getNetworkInfo(1).getState() != NetworkInfo.State.CONNECTED)
          break;
        i = 1;
      }
      i = 0;
    }
  }

  private static String j(Context paramContext)
  {
    Object localObject = null;
    try
    {
      String str = ((WifiManager)paramContext.getSystemService("wifi")).getConnectionInfo().getMacAddress();
      localObject = str;
      return localObject;
    }
    catch (Exception localException)
    {
      if (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "Could not read MAC, forget to include ACCESS_WIFI_STATE permission?", localException);
    }
  }

  private static Location k(Context paramContext)
  {
    Location localLocation;
    if (!(MobclickAgent.mUseLocationService))
      localLocation = null;
    while (true)
    {
      return localLocation;
      localLocation = new k(paramContext).a();
    }
  }

  private static JSONObject l(Context paramContext)
  {
    JSONObject localJSONObject = new JSONObject();
    SharedPreferences localSharedPreferences = MobclickAgent.a(paramContext);
    try
    {
      if (localSharedPreferences.getInt("gender", -1) != -1)
        localJSONObject.put("sex", localSharedPreferences.getInt("gender", -1));
      if (localSharedPreferences.getInt("age", -1) != -1)
        localJSONObject.put("age", localSharedPreferences.getInt("age", -1));
      if (!("".equals(localSharedPreferences.getString("user_id", ""))))
        localJSONObject.put("id", localSharedPreferences.getString("user_id", ""));
      if (!("".equals(localSharedPreferences.getString("id_source", ""))))
        localJSONObject.put("url", URLEncoder.encode(localSharedPreferences.getString("id_source", "")));
      int i = localJSONObject.length();
      if (i > 0)
        return localJSONObject;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      localJSONObject = null;
    }
  }
}